argo: warn sendv() caller when ring is full
authorNicholas Tsirakis <niko.tsirakis@gmail.com>
Tue, 11 Jun 2019 17:11:24 +0000 (13:11 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 11 Jun 2019 19:27:28 +0000 (20:27 +0100)
commit480800c76969b38f13b6909eb679b23571417538
tree3b47ef1609cc2c1f9f316c1639849e177ae7cdea
parentdecfc03f54b821877f64f28beba15124940470b5
argo: warn sendv() caller when ring is full

In its current state, if the destination ring is full, sendv()
will requeue the message and return the rc of pending_requeue(),
which will return 0 on success. This prevents the caller from
distinguishing the difference between a successful write and a
message that needs to be resent at a later time.

Instead, capture the -EAGAIN value returned from ringbuf_insert()
and *only* overwrite it if the rc of pending_requeue() is non-zero.
This allows the caller to make intelligent decisions on -EAGAIN and
still be alerted if the pending message fails to requeue.

Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>
xen/common/argo.c